package roborally.Conditions;

import roborally.Placeable;
import roborally.Robot;
import roborally.Statement;

/**
 * A class of Conditions for playing the roborally game.
 * 
 * @version  2.90
 * @author   Michiel Ruelens & Dieter Naten
 */
public abstract class Condition extends Statement {
	
	/**
	 * For most conditions there is no need to have multiple instances, so only 1 is being created and reused whenever needed.
	 * An exception is being made for BoardRange and Energy_at_least. For these classes parameters are required and thus different instances
	 * with different parameters must exist. Although for each set of parameters there must only exist 1 object. So again steps have been taken
	 * to ensure no duplicates exist. As a result of this, the method getInstance() in these classes is replaced by the equally named method getInstance(...)
	 * where '...' is replaced by the corresponding required parameters.
	 */
	public abstract Condition getInstance();
	
	/**
	 * All conditions must have the validate method which will check their condition for the given placeable.
	 */
	@Override
	public abstract boolean validate(Placeable placeable);

}
